module FriendshipHelper
  
  def friendship_status(user,friend)
    friendship = Friendship.find_by_user_id_and_friend_id(user,friend)
    return '' if user==friend
    return "#{friend.username}还不是您的好友" if friendship.nil?
    case friendship.status
      when 'requested'
        "#{friend.username}请求成为您的好友"
      when 'pending'
        "已向#{friend.username}发送好友请求"
      when 
        "#{friend.username} 成为您的好友"        
    end
  
  end
end
